package wechat

import (
	"github.com/micro/go-micro/v2"
	"github.com/micro/go-micro/v2/client"
	pb "micro-grpc-server/services/wechat/proto"
)

func NewWechatClient() pb.WechatService {
	server := micro.NewService(
		micro.Name("go.micro.srv.wechat.client"),
		micro.Version("latest"),
	)
	server.Init()

	cli := server.Client()
	// 禁止自动重试
	_ = cli.Init(client.Retries(0))
	return pb.NewWechatService("go.micro.srv.wechat", cli)
}
